package com.shop.servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.shop.service.GoodsService;
import com.shop.service.impl.GoodsServiceImpl;


@WebServlet("/deleteGoods.do")
public class DeleteGoodsServlet extends HttpServlet {
	GoodsService goodsService = new GoodsServiceImpl();
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		String GoodsId = request.getParameter("GoodsId");
		System.out.println("删除的id"+GoodsId);
		int goodsId = Integer.parseInt(GoodsId);
		goodsService.deleteGoods(goodsId);
		response.sendRedirect("selectGoods.do");
	}

}
